/**
 * Created by hps on 17-4-30.
 */
public class LinkList1 {
    private Link1 first;

    public boolean isEmpty() {
        return first == null;
    }

    public void insertFirst(long dd) {
        Link1 newLink = new Link1(dd);
        newLink.next = first;
        first = newLink;
    }

    public long deleteFirst() {
        Link1 temp = first;
        first = first.next;
        return temp.dData;
    }

    public void  displayList() {
        Link1 current = first;
        while (current != null) {
            current.displayLink();
            current = current.next;
        }
        System.out.println();
    }
}
